<template>
  <router-link :to="`/information`">
    <div
      class="bt-wrapper"
      @mouseover="changeIcon(1)"
      @mouseleave="changeIcon(2)"
    >
      <span>全部</span>
      <img
        v-if="isHovered"
        src="../../../assets/images/bt_arrow_selected.png"
        alt="arros"
      />
      <img v-else src="../../../assets/images/bt_arrow.png" alt="arros" />
    </div>
  </router-link>
</template>

<script lang="ts">
export default {
  name: "infoButton",
  data() {
    return {
      isHovered: false,
    };
  },
  methods: {
    changeIcon(type) {
      if (type === 1) {
        this.isHovered = true;
      } else {
        this.isHovered = false;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.bt-wrapper {
  width: 130px;
  height: 34px;
  line-height: 34px;
  background: #ffffff;
  color: #2590f4;
  border: 1px solid #2590f4;
  span {
    font-size: 14px;
    margin-right: 10px;
  }
  img {
    width: 32px;
    height: 11px;
  }
  &:hover {
    background: #2590f4;
    color: #fff;
  }
}
</style>
